package cn.com.bluemoon.daps.domp.api;

import cn.com.bluemoon.daps.common.constant.ServiceNameConstants;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(name = ServiceNameConstants.DapsApiDomp.KAFKA_SERVICE,fallback = KafkaServiceHystric.class)
@Api(tags = "FeignClient服务-卡夫卡发送服务bd-util-kafka")
public interface KafkaClient {

	@RequestMapping(value = "/kafka/sendMessage", method = RequestMethod.POST)
	public String sendMessage(@RequestParam("topic") String topic, @RequestParam("value") String value);

	@RequestMapping(value = "/kafka/sendKeyMessage", method = RequestMethod.POST)
	public String sendMessage(@RequestParam("topic") String topic, @RequestParam("key") String key,
                              @RequestParam("value") String value);

}
